copyright_msg db "Packet driver for the MICOM-Interlan NI9210, version ",'0'+(majver / 10),'0'+(majver mod 10),".",'0'+version,".",'0'+i82586_version,CR,LF
db "Portions Copyright 1988 The Board of Trustees of the University of Illinois",CR,LF,'$'
IRQ_MASK equ 06h
IRQ_TABLE db 9 ; Interrupt Value 0
db 10 ; Interrupt Value 1
db 11 ; Interrupt Value 2
db 3 ; Interrupt Value 3
check_board:
mov SCP,0 ; 16 bit bus type in scb.
;The following code to read the POS registers is courtesy of Racal-Interlan.
; channel selector resides at io 96h
; POS register base is at io 100h
; 9210 ID is 0DF0Fh
; search thro' the slots for a 9210 card
mov cx, 8 ; for all channels(slots)
; channel select value for slots 0,1,2.. is 8,9,A etc
; start with slot 0, and then 7,6,5,4,3,2,1
get_05:
mov ax, cx ; channel number
or ax, 08h ; reg. select value
mov dx, 96h ; channel select register
out dx, al ; select channel
; read adapter id
mov dx, 100h
in al, dx ; adapter id - ms byte
mov ah, al
inc dx
in al, dx ; adapter id - ls byte
; Check if 9210
cmp ax, 0DF0Fh
je get_10
loop get_05
mov dx,offset no_9210_msg
jmp error
get_10:
; found our Adapter
; Get Ni9210 I/O Address ( read POS Register 1 )
xor ax,ax
mov dx,103h
in al,dx
xor ah,ah
mov cl,5
shl ax,cl
mov io_addr,ax
; Get Ni9210 IRQ ( read POS Register 0 )
mov dx,102h
in al,dx
mov bl,al
and bx,IRQ_MASK
shr bx,1
mov al,IRQ_TABLE[bx]
mov int_no,al
; Get Memory Address ( read POS Registers 2 and 3 )
mov dx,105h
in al,dx
mov ah,al
dec dx
in al,dx
and ax,3fe0h
mov cl,5
shl ax,cl
mov base_addr,ax
mov dx, 102h
in al,dx
or al,1 ;enable the card.
out dx,al
mov dx, 96h ;deselect the card.
xor al,al
out dx,al
mov dx,io_addr ; i/o address
add dx,EADDR_LEN*2 ; look past the ethernet address.
in al,dx
mov bl,al ; assemble pattern to check
add dx,2
in al,dx
mov bh,al
cmp bx,05500h ; pattern known to be there in ROM
jz have_9210_io
pop dx ;drop our return address
mov dx,offset no_9210_io_msg
jmp error
have_9210_io:
mov ax,base_addr
mov cx,2000h ;test only what we are going to use.
call memory_test
jz have_9210_mem
pop dx ;drop our return address
mov dx,offset no_9210_mem_msg
jmp error
have_9210_mem:
ret
no_9210_msg db "No 9210 found.",CR,LF,'$'
no_9210_io_msg db "No 9210 found at that I/O address.",CR,LF,'$'
no_9210_mem_msg db "No 9210 found at that memory address.",CR,LF,'$'